<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh">
<head>        
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    
    <!--[if gt IE 8]>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />        
    <![endif]-->        
    
    <title>${prop }报名系统</title>
     
    <%@include file="res.jsp" %>
     
</head>
<body>    

    <jsp:include page="header.jsp"></jsp:include>

   	<jsp:include page="menu.jsp"></jsp:include>
   
	<jsp:include page="com_bbs.jsp"></jsp:include>
    <div class="content"> 
     	<script type="text/javascript">
     	
     		function opt_properties(sel)
     		{
         		var singupId = sel.options[sel.options.selectedIndex].value ;
         		if(singupId.length > 0)
         		{ 
             		$.get("<%=basePath %>page/prop_edit.action?id="+singupId+"&time="+(new Date().valueOf()),function(data,status){ 
             		    $("#properties_ajax").html(data) ;  
             		 });
         		}
         		else
         		{
         			 self.location='<%=basePath %>page/singup_properties.action';
         		}
     		}
     		 
     	</script>
     	
     	<c:choose>
    		<c:when test="${opt == 'success'}">
    			<div class="alert alert-success">            
                        <strong>恭喜你</strong>, 操作成功 
                </div>
                <% request.getSession().removeAttribute("opt") ; %>
    		</c:when>
    		<c:when test="${opt == 'error'}">
    			<div class="alert alert-error">            
                        <strong>不好意思 </strong>, 操作失败的了 
                </div>
                <% request.getSession().removeAttribute("opt") ; %>
    		</c:when> 
    	</c:choose>
     	
        <div class="row-fluid">
                        
            <div class="span12">
                
                <div class="widget">   
                  <form action="page/prop_add.action" method="post" id="validate" >                  
                    <div class="head dark">
                        <div class="icon"><span class="icos-box-add"></span></div>
                        <h2>报名属性值</h2>
                    </div>               
                                                      
                    <div class="toolbar">
                        <div class="left">
                          <select name="singupId" class="validate[required]" onchange="opt_properties(this)">
                                    <option value="">选择报名</option>
                                    <c:forEach items="${singups}" var="singup">
                                    	<option value="${singup.id }">${singup.title }</option>
                                    </c:forEach>                                                
                            </select> 
                        </div> 
                        
                    </div>
                    
                    <div class="block-fluid" id="properties_ajax">
                        
                         <jsp:include page="singup_properties_ajax.jsp"></jsp:include>
                        
                    </div>
                    <div class="toolbar bottom TAL">
								<button class="btn btn-primary">
									确定
								</button> 
							</div>
                    </form>
                </div>
                
            </div>
           
        </div>

    </div>  
    <div id="value_ajax">
    	 
    </div>
       
        
</body>
</html>

